/*
 ============================================================================
 Name        : myObjDump.c
 Author      : 
 Version     :	1
 Copyright   : Your copyright notice
 Description : Main class
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "library/debug.h"
#include "consoleParser/consoleParser.h"
#include "fileLoader/fileLoader.h"
#include "process/commandProcess/commandProcess.h"
#include "process/instructionRefParser/insParser.h"

//test

char* pArgFiles[20]; ///<File name
char pArg[20]; ///<List of commands

unsigned long size; ///< File size
int fd; ///< Pointer to binary file

/*! \fn main(int argc, char* argv[])
 \brief Main function.
 \param argc Number of arguments.
 \param arg[] Array of arguments.
 */

int main(int argc, char* argv[]) {

	char status;
	//hh();
	printf("Program name: %s\n", argv[0]);
	status = parseConsoleInput(argc, argv, pArgFiles, pArg);
	ERROR_HANDLE(status);

	if(pArgFiles[0]!=0)
		status = openBinaryFile(pArgFiles[0], &fd);
	ERROR_HANDLE(status);

	status = processInput(pArg, fd);

	close(fd);
	return EXIT_SUCCESS;
}
